mudbox::SurfacePoint Struct Reference

#include <mesh.h>

List of all members.


Detailed Description

SurfacePoint objects are generally returned by Picker objects, who have interpreted a user action that involves selecting a point on the mesh.

Meshs are defined as having an inside (back face) and an outside (front face).


Public Member Functions

  SurfacePoint (void)
  Void Constructor.
  SurfacePoint (Mesh *pMesh, unsigned int iVertexIndex, unsigned int iFaceIndex)
  Constructor.
Vector  WorldPosition (void) const
  Returns the position of the SurfacePoint in world space.
Vector  WorldNormal (void) const
  Returns the normal of the selected face in world space.
Vector  FaceCoordinates (void) const
  Returns a 2d vector indicating the position of the selected point within its face.
Vector  InterpolatedNormal (void) const
  Returns the normal at the selected point interpolated from the surrounding Vertex normals in local space.
bool  Fill (const Mesh *pMesh, unsigned int iFaceIndex, const Vector &vStart, const Vector &vEnd, bool bTwoSide=false)
  Set the SurfacePoint values based on a line in local space.

Public Attributes

Mesh m_pMesh
  the mesh that has been picked
unsigned int  m_iFaceIndex
  the index of the face that has been picked
float  m_fRelativeRange
  position of a mesh-line intersection relative to the line. Ranges from 0.0 (at the beginning of the line) to 1.0 (at the end).
Vector  m_vLocalPosition
  position of the point in local space
Vector  m_vLocalNormal
  the normal vector of the mesh at the picked point, in local space
bool  m_bSide
  if true, the backside of the face was selected. (This is not supported; use at your own risk.)
Vector  m_vFaceCoordinates

Constructor & Destructor Documentation

mudbox::SurfacePoint::SurfacePoint void   ) 
 

Void Constructor.

mudbox::SurfacePoint::SurfacePoint Mesh pMesh,
unsigned int  iVertexIndex,
unsigned int  iFaceIndex
 

Constructor.

Parameters:
pMesh  [in] the mesh
iVertexIndex  [in] the index of a vertex on the mesh
iFaceIndex  [in] the index of a face on the mesh

Member Function Documentation

Vector mudbox::SurfacePoint::WorldPosition void   )  const
 

Returns the position of the SurfacePoint in world space.

Vector mudbox::SurfacePoint::WorldNormal void   )  const
 

Returns the normal of the selected face in world space.

Vector mudbox::SurfacePoint::FaceCoordinates void   )  const
 

Returns a 2d vector indicating the position of the selected point within its face.

Vector mudbox::SurfacePoint::InterpolatedNormal void   )  const
 

Returns the normal at the selected point interpolated from the surrounding Vertex normals in local space.

bool mudbox::SurfacePoint::Fill const Mesh pMesh,
unsigned int  iFaceIndex,
const Vector vStart,
const Vector vEnd,
bool  bTwoSide = false
 

Set the SurfacePoint values based on a line in local space.

This method looks at the line defined by vStart and vEnd and sees if it intersects the specified mesh and face. If it does, the remainder of the SurfacePoint values are filled in. The line in local space might represent the vector defined by the user clicking a point on the screen.

Parameters:
pMesh  [in] the mesh
iFaceIndex  [in] the index of a face
vStart  [in] start point of a line defined in local space
vEnd  [in] end point of a line defined in local space
bTwoSide  [in] if true, allow both sides of the face to be considered

Member Data Documentation

Mesh* mudbox::SurfacePoint::m_pMesh
 

the mesh that has been picked

unsigned int mudbox::SurfacePoint::m_iFaceIndex
 

the index of the face that has been picked

float mudbox::SurfacePoint::m_fRelativeRange
 

position of a mesh-line intersection relative to the line. Ranges from 0.0 (at the beginning of the line) to 1.0 (at the end).

Vector mudbox::SurfacePoint::m_vLocalPosition
 

position of the point in local space

Vector mudbox::SurfacePoint::m_vLocalNormal
 

the normal vector of the mesh at the picked point, in local space

bool mudbox::SurfacePoint::m_bSide
 

if true, the backside of the face was selected. (This is not supported; use at your own risk.)

Vector mudbox::SurfacePoint::m_vFaceCoordinates [mutable]